<template>
  <div class="stat">
    <span>房间总数量：{{totalCount}}</span>
    <div>
      <span>房间占比</span>
      <el-progress :percentage="percentage"></el-progress>
    </div>

    <span>总订单数量：</span><span>{{total}}</span>     <br>
    <span>今日订单数量：</span><span>{{todayCount}}</span>     <br>
    <span>今日未结算数量：</span><span>{{todayNotBillCount}}</span>     <br>
    <span>总未结算数量：</span><span>{{notBillCount}}</span>     <br>
    <span>今日营收：</span><span style="color: crimson">{{profit}}</span>
  </div>
</template>

<script>
import {getRoomCount} from "@/api/RoomApi";
import {getTodayProfit} from "@/api/OrderApi";

export default {
  name: "Stat",
  data() {
    return {
      percentage: 0,
      totalCount: 0,
      profit: 0,
      totalOrder: 0,
      todayCount: 0,
      todayNotBillCount: 0,
      notBillCount: 0,
      total: 0
    }
  },
  methods: {},
  created() {
    getRoomCount().then(res => {
      this.totalCount = res['data']['totalCount']
      this.percentage = res['data']['hasCount'] * 100 / this.totalCount
    })
    getTodayProfit().then(res => {
      this.profit = res['data']['profit']
      this.todayCount = res['data']['todayCount']
      this.todayNotBillCount = res['data']['todayNotBillCount']
      this.notBillCount = res['data']['notBillCount']
      this.total = res['data']['total']
    })
  }
}
</script>

<style scoped>

</style>